<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订购成功</title>
    <link rel="stylesheet" href="./index.css">
</head>

<body>
    <div class="wrap_success">
        <div class="success_title">订购成功</div>
        <img src="./success.png" alt="">
        <div class="success_text">请耐心等待权益发放，您可以点击"返回首页"后再次点击将可激活用户权益</div>
        <div class="success_btn">
            返回首页
        </div>
    </div>
</body>

<script src="./jq.js"></script>
<script>
    function getDeviceType() {
        var userAgent = navigator.userAgent || navigator.vendor || window.opera;

        // 判断是否为iOS设备  
        if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
            return 'iOS';
        }

        // 判断是否为Android设备  
        if (/android/i.test(userAgent)) {
            return 'Android';
        }

        // 如果都不是，则返回其他或未知  
        return 'Other';
    }

    $('.success_btn').on('click', function (event) {
        console.log('555');
        let app = getDeviceType()
        if(app==='iOS'){
            window.webkit.messageHandlers.backHome.postMessage('webview点击了backHome')
        }

        if(app==='Android'){
            window.android.callAndroid('webview点击了backHome');
        }
      

    });

</script>


</html>